package com.fas.system.mapper;

import com.fas.system.domain.FasEquipment;
import com.fas.system.domain.vo.EquipmentAlarmVo;
import com.fas.system.domain.vo.NumberStatistics;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 设备信息Mapper接口
 *
 * @author ruoyi
 * @date 2022-05-05
 */
public interface FasEquipmentMapper
{
    /**
     * 查询设备信息
     *
     * @param id 设备信息主键
     * @return 设备信息
     */
    public FasEquipment selectFasEquipmentById(@Param("id") Long id, @Param("deptId")Long deptId);

    /**
     * 查询设备信息列表
     *
     * @param fasEquipment 设备信息
     * @return 设备信息集合
     */
    public List<FasEquipment> selectFasEquipmentList(FasEquipment fasEquipment);

    /**
     * 新增设备信息
     *
     * @param fasEquipment 设备信息
     * @return 结果
     */
    public int insertFasEquipment(FasEquipment fasEquipment);

    /**
     * 修改设备信息
     *
     * @param fasEquipment 设备信息
     * @return 结果
     */
    public int updateFasEquipment(FasEquipment fasEquipment);

    /**
     * 删除设备信息
     *
     * @param id 设备信息主键
     * @return 结果
     */
    public int deleteFasEquipmentById(Long id);

    /**
     * 批量删除设备信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFasEquipmentByIds(Long[] ids);

    /**
     * 总公司
     * @param fasEquipment
     * @return
     */
    List<FasEquipment> findAllEquipment(FasEquipment fasEquipment);

    List<FasEquipment> findLikeEngineer(FasEquipment fasEquipment);

    List<FasEquipment> equipmentdetails(String equipmentNumber);

    Long countEquipment(FasEquipment fasEquipment);

    List<FasEquipment> findAll(FasEquipment fasEquipment);

    /**
     *
     * @param equipmentNumber 设备编号
     * @param unread    消息是否已读（1：未读，2：已读）
     * @return
     */
    List<EquipmentAlarmVo> selectHomePageById(@Param("equipmentNumber") String equipmentNumber,@Param("unread")Integer unread);
    /**
     *
     * @param equipmentNumber 设备编号
     * @param unread    消息是否已读（1：未读，2：已读）
     * @return
     */
    List<EquipmentAlarmVo> selectHomePageByUserId(@Param("equipmentNumber") String equipmentNumber,@Param("unread")Integer unread,
                                              @Param("userId") Integer userId);

    int updateByEquipmentNumber(FasEquipment equipment);

    List<FasEquipment> miniappEquipmentList(FasEquipment fasEquipment);

    List<Integer> selectAllCompany();

    List<NumberStatistics> statisticalBySystemId(@Param("systemId")String systemId, @Param("cooperationCompanyId")Integer cooperationCompanyId);

    int batchInsertEquipment(@Param("list") List<FasEquipment> equipmentList);
}
